package proyectocatalina.matricula;
import LogicadeNegocio.ComboActividad;
import LogicadeNegocio.ComboCarrera;
import LogicadeNegocio.ComboColegio;
import LogicadeNegocio.ComboDepartamento;
import LogicadeNegocio.ComboDistrito;
import LogicadeNegocio.ComboProvincia;
import LogicadeNegocio.Comboturno;
import LogicadeNegocio.VerSexo1;
import java.util.logging.Level;
import java.util.logging.Logger;
import modelo.beanActividadLaboral;
import modelo.beanColegio;
import modelo.beanDistrito;
import modelo.beancarrera;
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;
//import org.jdesktop.swingx.autocomplete.*;

public class RegistrarAlumno2 extends javax.swing.JInternalFrame{
ComboDepartamento cbdepartamento;
ComboProvincia cbprovincia;
Comboturno cbturno;
ComboCarrera cbcarrera;
ComboActividad cbactividad;
VerSexo1 cbsexo;
ComboColegio cbcolegio;
ComboDistrito cbdistrito;
private beanColegio[] colegio;

    /** Creates new form RegistrarAlumno */
    public RegistrarAlumno2() {
        try {
            initComponents();
            cbdistrito = new ComboDistrito(this.jdistrito);
            cbcolegio = new ComboColegio(this.jcole);
            cbcolegio.cargarcombos();
            cbactividad = new ComboActividad(this.jactividad);
            cbactividad.cargarcombos();
            cbturno = new Comboturno(this.jturno);
            cbturno.cargarcarreras();
            cbcarrera = new ComboCarrera(this.jcarrera);
            cbcarrera.cargarcombos();
            cbsexo = new VerSexo1(this.jsexo);
            cbsexo.vercombosexo();
            cbdepartamento = new ComboDepartamento(jdepartamento);
            cbprovincia = new ComboProvincia(jProvincia);
            cbdepartamento.cargardepart1();
            AutoCompleteDecorator.decorate(this.jsexo);
            AutoCompleteDecorator.decorate(this.jdepartamento);
            AutoCompleteDecorator.decorate(this.jProvincia);
            AutoCompleteDecorator.decorate(this.jactividad);
            AutoCompleteDecorator.decorate(this.jcole);
            AutoCompleteDecorator.decorate(this.jcarrera);
            AutoCompleteDecorator.decorate(this.jturno);
            AutoCompleteDecorator.decorate(this.jdistrito);
        } catch (Exception ex) {
            Logger.getLogger(RegistrarAlumno2.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPopupMenu1 = new javax.swing.JPopupMenu();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jEImagePanel1 = new proyectocatalina.JEImagePanel();
        jresidenciadireccion = new javax.swing.JTextField();
        jresidencianumero = new javax.swing.JTextField();
        jDni = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jcole = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        jactividad = new javax.swing.JComboBox();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jfecha = new com.toedter.calendar.JDateChooser();
        jLabel4 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jnombres = new javax.swing.JTextField();
        japematerno = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        japepaterno = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jsexo = new javax.swing.JComboBox();
        jdepartamento = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jProvincia = new javax.swing.JComboBox();
        jdistrito = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        jcarrera = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jturno = new javax.swing.JComboBox();
        jResidencialugar = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();

        jPopupMenu1.setName("Menu contextual"); // NOI18N

        jMenuItem4.setText("Limpiar Texto");
        jPopupMenu1.add(jMenuItem4);

        jMenuItem1.setText("Copiar");
        jPopupMenu1.add(jMenuItem1);

        jMenuItem2.setText("Cortar");
        jPopupMenu1.add(jMenuItem2);

        jMenuItem3.setText("Pegar");
        jPopupMenu1.add(jMenuItem3);

        setClosable(true);
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setForeground(java.awt.Color.white);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Registrar Alumnos");

        jEImagePanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Datos Personales"));
        jEImagePanel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jEImagePanel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/Imagen fondo aurora celeste.png"))); // NOI18N

        jresidenciadireccion.setToolTipText("<html><font color = #8A0829>Direccion donde reside</font></html>");

        jDni.setToolTipText("(Solo numeros) DNI del alumno");
        jDni.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jDniActionPerformed(evt);
            }
        });
        jDni.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jDniKeyTyped(evt);
            }
        });

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel9.setText("DNI:");

        jLabel15.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel15.setText("Residencia Direccion:");

        jLabel17.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel17.setText("Residencia Numero:");

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel11.setText("Colegio de Procedencia:");

        jcole.setEditable(true);
        jcole.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jcole.setToolTipText("<html><font color = #8A0829>Colegio de donde procede</font></html>");

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel8.setText("Actividad Laboral:");

        jactividad.setEditable(true);
        jactividad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jactividad.setToolTipText("<html><font color = #8A0829>Actividad laboral en la que se desempeña</font></html>");

        jButton6.setText("jButton2");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jButton7.setText("jButton2");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jfecha.setToolTipText("<html><font color = #8A0829>Fecha de nacimiento</font></html>");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel4.setText("Fecha de Nacimiento:");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel3.setText("Nombres:");

        jnombres.setToolTipText("<html><font color = #8A0829>Nombres completos del alumno</font></html>");

        japematerno.setToolTipText("<html><font color = #8A0829>Apellido materno del alumno</font></html>");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("Apellido Materno:");

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("Apellido Paterno:");

        japepaterno.setToolTipText("<html><font color = #8A0829>Apellido Paterno del Alumno</font></html>");

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel5.setText("Sexo:");

        jsexo.setEditable(true);
        jsexo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 2", "Item 3", "Item 4" }));
        jsexo.setToolTipText("<html><font color = #8A0829>Sexo: H (Hombre) - M (Mujer)</font></html>");
        jsexo.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jsexoFocusGained(evt);
            }
        });

        jdepartamento.setEditable(true);
        jdepartamento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jdepartamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jdepartamentoActionPerformed(evt);
            }
        });
        jdepartamento.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                jdepartamentoFocusLost(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel6.setText("Departamento :");

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel10.setText("Provincia:");

        jProvincia.setEditable(true);
        jProvincia.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jProvincia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jProvinciaActionPerformed(evt);
            }
        });
        jProvincia.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jProvinciaFocusGained(evt);
            }
        });

        jdistrito.setEditable(true);
        jdistrito.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jdistrito.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jdistritoFocusGained(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel7.setText("Distrito:");

        jcarrera.setEditable(true);
        jcarrera.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jcarrera.setToolTipText("<html><font color = #8A0829>Carrera al que ingreso el nuevo alumno</font></html>");
        jcarrera.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcarreraActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel12.setText("Carrera:");

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel13.setText("Turno:");

        jturno.setEditable(true);
        jturno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jturno.setToolTipText("<html><font color = #8A0829>Turno al que ingreso el alumno</font></html>");

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel16.setText("Residencia Lugar:");

        javax.swing.GroupLayout jEImagePanel1Layout = new javax.swing.GroupLayout(jEImagePanel1);
        jEImagePanel1.setLayout(jEImagePanel1Layout);
        jEImagePanel1Layout.setHorizontalGroup(
            jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEImagePanel1Layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1)
                    .addComponent(jLabel4)
                    .addComponent(jLabel8)
                    .addComponent(jLabel11)
                    .addComponent(jLabel15)
                    .addComponent(jLabel17))
                .addGap(43, 43, 43)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addComponent(jresidencianumero, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 123, Short.MAX_VALUE)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jDni, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jresidenciadireccion, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(jfecha, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(japepaterno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(jnombres, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addComponent(japematerno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE)
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jcole, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jactividad, 0, 291, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jLabel5))
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)
                            .addComponent(jLabel12)
                            .addComponent(jLabel13)
                            .addComponent(jLabel16))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jProvincia, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jdepartamento, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jcarrera, 0, 254, Short.MAX_VALUE)
                        .addComponent(jturno, 0, 254, Short.MAX_VALUE)
                        .addComponent(jResidencialugar, javax.swing.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE)
                        .addComponent(jsexo, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jdistrito, 0, 272, Short.MAX_VALUE))
                .addContainerGap())
        );
        jEImagePanel1Layout.setVerticalGroup(
            jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jEImagePanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(japepaterno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel5)
                    .addComponent(jsexo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(japematerno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2)
                    .addComponent(jLabel6)
                    .addComponent(jdepartamento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jnombres, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel10)
                    .addComponent(jProvincia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jfecha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(jdistrito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jactividad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel8)
                            .addComponent(jButton6)
                            .addComponent(jLabel12))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jcole, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel11)
                            .addComponent(jButton7))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel15)
                            .addComponent(jresidenciadireccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16)
                            .addComponent(jResidencialugar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(jresidencianumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jDni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9)))
                    .addGroup(jEImagePanel1Layout.createSequentialGroup()
                        .addComponent(jcarrera, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEImagePanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jturno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/matricula_datos.png"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jEImagePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(jButton1)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jEImagePanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 70, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed


    }//GEN-LAST:event_jButton8ActionPerformed

    private void jDniActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDniActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jDniActionPerformed

    private void jDniKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jDniKeyTyped

}//GEN-LAST:event_jDniKeyTyped

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed

}//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed

}//GEN-LAST:event_jButton7ActionPerformed

    private void jsexoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jsexoFocusGained

}//GEN-LAST:event_jsexoFocusGained

    private void jdepartamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jdepartamentoActionPerformed
            if(jdepartamento.getSelectedIndex() != -1){
               try {
                        cbprovincia.cargarprovin(jdepartamento.getItemAt(jdepartamento.getSelectedIndex()).toString());
                    } catch (Exception ex) {
                        Logger.getLogger(RegistrarAlumno2.class.getName()).log(Level.SEVERE, null, ex);
                    }
            }
    }//GEN-LAST:event_jdepartamentoActionPerformed

    private void jdepartamentoFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jdepartamentoFocusLost

}//GEN-LAST:event_jdepartamentoFocusLost

    private void jProvinciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jProvinciaActionPerformed
            if(this.jProvincia.getSelectedIndex() != -1){
               try {
                        cbdistrito.cargardist(jProvincia.getItemAt(jProvincia.getSelectedIndex()).toString());
                    } catch (Exception ex) {
                        Logger.getLogger(RegistrarAlumno2.class.getName()).log(Level.SEVERE, null, ex);
                    }
            }
}//GEN-LAST:event_jProvinciaActionPerformed

    private void jProvinciaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jProvinciaFocusGained





    }//GEN-LAST:event_jProvinciaFocusGained

    private void jdistritoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jdistritoFocusGained
        // TODO add your handling code here:
}//GEN-LAST:event_jdistritoFocusGained

    private void jcarreraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcarreraActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jcarreraActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    java.util.Date utilDate = jfecha.getDate(); //fecha actual
    long lnMilisegundos = utilDate.getTime();
    java.sql.Date sqlDate = new java.sql.Date(lnMilisegundos);
    CapadeDatos.DaoAlumno nuevoalumno = new CapadeDatos.DaoAlumno();
    beanActividadLaboral[] actividad = cbactividad.actividadlaboral();
    colegio = cbcolegio.colegios();
    beancarrera[] carreraver = cbcarrera.semestre();
    beanDistrito[] verdistrito = cbdistrito.unidadespro();
     nuevoalumno.insertarusuario(this.japepaterno.getText(), this.japematerno.getText(),this.jnombres.getText(),sqlDate,
                                this.jsexo.getSelectedItem().toString(),  verdistrito[this.jdistrito.getSelectedIndex()].getCod_distri(),this.jDni.getText(),
                                actividad[this.jactividad.getSelectedIndex()].getCod_act(),
                                colegio[this.jcole.getSelectedIndex()].getCod_proce(),
                                this.jresidenciadireccion.getText(),this.jresidencianumero.getText(),this.jResidencialugar.getText(),carreraver[this.jcarrera.getSelectedIndex()].getCodigo(), cbturno.turno(this.jturno.getSelectedIndex()));  
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
    * @param args the command line arguments
    */
   

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new RegistrarAlumno2().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JTextField jDni;
    private proyectocatalina.JEImagePanel jEImagePanel1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JComboBox jProvincia;
    private javax.swing.JTextField jResidencialugar;
    private javax.swing.JComboBox jactividad;
    private javax.swing.JTextField japematerno;
    private javax.swing.JTextField japepaterno;
    private javax.swing.JComboBox jcarrera;
    private javax.swing.JComboBox jcole;
    private javax.swing.JComboBox jdepartamento;
    private javax.swing.JComboBox jdistrito;
    private com.toedter.calendar.JDateChooser jfecha;
    private javax.swing.JTextField jnombres;
    private javax.swing.JTextField jresidenciadireccion;
    private javax.swing.JTextField jresidencianumero;
    private javax.swing.JComboBox jsexo;
    private javax.swing.JComboBox jturno;
    // End of variables declaration//GEN-END:variables

}
